package com.dss.auto_deploy.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dss.auto_deploy.domain.AdmDocker;
import com.dss.auto_deploy.vo.AdmDockerVo;
import com.dss.auto_deploy.dto.AdmDockerAddDto;
import com.dss.auto_deploy.dto.AdmDockerPageDto;
import com.dss.auto_deploy.dto.AdmDockerUpdateDto;
import com.dss.auto_deploy.dto.DockerInstallDto;
import com.github.dockerjava.api.model.Container;

import java.util.List;
import java.util.Map;

/**
* @Description:docker界面地址Service
* @author dongshoushan
* @date 2022-09-22 14:38:54
*/
public interface IAdmDockerService  extends IService<AdmDocker> {
    /**
    * 新增docker界面地址
    * @param admDockerAddDto
    * @return
    */
    int insert(AdmDockerAddDto admDockerAddDto);

    /**
    * 修改docker界面地址
    * @param admDockerUpdateDto
    * @return
    */
    int update(AdmDockerUpdateDto admDockerUpdateDto);

    /**
    * 批量删除docker界面地址
    * @param ids
    * @return
    */
    void deleteBatch(Long[] ids);

    /**
    * docker界面地址查询
    * @param dto
    * @return List<AdmDocker>
    */
    Page<AdmDockerVo> list(AdmDockerPageDto dto);


    List<AdmDocker> getAll(String name);
    List<AdmDocker> getAll();

    /**
     * 根据ip查询docker
     * @param ip
     * @return
     */
    AdmDocker getByIp(String ip);

    /**
     * 根据仓库id查询docker
     * @param registryId
     * @return
     */
    AdmDocker getByRegistryId(Long registryId);

    void install(DockerInstallDto installDto);

    List<AdmDockerVo> convertToVo(List<AdmDocker> list);
    AdmDockerVo convertToVo(AdmDocker admDocker);
    AdmDockerVo getVoById(Long id);

    void init();

    Map<String, List<Container>> getContainerMapByVo(List<AdmDockerVo> admDockers) throws InterruptedException;
    Map<String, List<Container>> getContainerMap(List<AdmDocker> dockerList) throws InterruptedException;
}
